<?php
namespace app\admin\validate;
use think\Validate;
class AdminGroup extends Validate
{

// 正则列
	protected $regexv =
	[
		'idcheck'=> '^[123456789]$|^[123456789][0-9]{0,3}$',
		'switch' => '[0]|[1]',
		'number'=>'^[123456789]$|^[123456789][\d]{0,10}$',
	];

	// 规则列
	protected $rule =
	[
		'id'		=>	'require|regex:number',
		'title'		=>	'require|chsDash',
		'status'	=>	'require|regex:switch',
		'note'		=>	'require|length:2,255',
	];

	// 消息列
	protected $message =
	[
		'id.require'			=>	'ID_Must_Input',
		'id.regex'				=>	'ID_Format_Error',

		'title.require'			=>	'Title_Must_Input',
		'title.chsDash'			=>	'Title_Format_Error',

		'status.require'		=>	'Status_Must_Input',
		'status.regex'			=>	'Status_Format_Error',

		'note.require'			=>	'Note_Must_Input',
		'note.length'			=>	'Length_Not_Range',
	];

	// 场景列
	protected $scene =
	[
		'groupadd'		=>	['title','status','note'],
		'groupedit'		=>	['id','title','status','note'],
		'groupid'		=>	['id'],
	];
}